﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DAL
{
    public class tbl_colseAlarm
    {
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("SELECT id,AlarmContent ");
            strSql.Append(" FROM tbl_colseAlarm ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            //return DBUnlity.DBHelpSQL.ExeSql(strSql.ToString());
            return DBUnlity.DBHelpSQL.Query(strSql.ToString());
        }

        public bool DeleteList(int ID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from tbl_colseAlarm ");
            strSql.Append(" where id ="+ID);
            int rows = DBUnlity.DbHelperSQL.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
